home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / MATHS / RLAB / RLAB125.ZIP / !RLaB / help_ai / format < prev    next >
Text File  |  1995-03-13  |  1KB  |  60 lines

  1. format:
  2.  
  3. Syntax:    format ( )
  4.     format ( precision )
  5.     format ( width , precision )
  6.     format ( [width, precision] )
  7.     
  8. Description:
  9.  
  10.     Format sets the output print format for all numeric output. If
  11.     no arguments are supplied, then the output print formats are
  12.     reset to the default values.
  13.  
  14.     If format is called with one argument, then the arguments
  15.     value specifies the format precision. If two arguments are
  16.     supplied, then the 1st specifies the format field width, and
  17.     the second specifies the format precision. The one, or two
  18.     arguments can also be the first two elements of a matrix
  19.     argument. 
  20.  
  21.     Format returns a 2-element matrix contains the previous width
  22.     and precision values. Subsequently, this matrix can be used to
  23.     reset format.
  24.  
  25. Example:
  26.  
  27.     > 123456789.123456789
  28.      1.235e+08
  29.  
  30.     > format(10);
  31.  
  32.     > 123456789.123456789
  33.     123456789.1
  34.  
  35.     > format();
  36.  
  37.     > a = rand(3,3)
  38.      a =
  39.      matrix columns 1 thru 3
  40.              1      0.3331      0.6646  
  41.         0.9745     0.03694     0.08467  
  42.         0.6475      0.1617      0.2041  
  43.  
  44.     > format(10);
  45.     > a
  46.      a =
  47.      matrix columns 1 thru 3
  48.     0.9999996424  0.3330855668  0.6646450162  
  49.     0.9745196104  0.03694454208  0.08467286825  
  50.     0.6474838853  0.1617118716  0.2041363865  
  51.  
  52.     > format(15,10);
  53.     > a
  54.      a =
  55.      matrix columns 1 thru 3
  56.        0.9999996424     0.3330855668     0.6646450162  
  57.        0.9745196104    0.03694454208    0.08467286825  
  58.        0.6474838853     0.1617118716     0.2041363865  
  59.  
  60.